]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
jsParse: Disambiguate regex
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 20 Aug 2019 21:20:31 +0000 (23:20 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 11 Sep 2019 20:59:31 +0000 (20:59 +0000)
Make it clear that /= is part of a regex and not an operator shorthand.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/710

js/misc/jsParse.js

index 05ab42337bcfb632b74c3e0147068fc56c549d6a..43e99cabcf305a89d3ea2eaaabd5cb0720003bd3 100644 (file)
@@ -217,7 +217,7 @@ function isUnsafeExpression(str) {
     prunedStr = prunedStr.replace(/[=!]==/g, '');    //replace === and !== with nothing
     prunedStr = prunedStr.replace(/[=<>!]=/g, '');    //replace ==, <=, >=, != with nothing
 
-    if (prunedStr.match(/=/)) {
+    if (prunedStr.match(/[=]/)) {
         return true;
     } else if (prunedStr.match(/;/)) {
         // If we contain a semicolon not inside of a quote/regex, assume we're unsafe as well